phasedir = [uigetdir '\'];

phasepattern = ['SegmentedColor*'];
phasefilelist = dir([phasedir phasepattern]);
for j=1:length(phasefilelist)
    phasefilelist(j).path=[phasedir phasefilelist(j).name];
end
phasefilenames = {phasefilelist.path}';
for k=1:length(phasefilenames)
    s = regexprep(phasefilenames{k}, 'SegmentedColorRe', 'SegmentedColorReT');
    movefile(phasefilenames{k},s)
    %outString{k}=s;
end

%movefile('myfunction.m','oldfunction.m')